import request from "../request"

///home/advertise/list 广告列表
export const advertiseListApi = (params?: IAdvertiseParams): RSP<IAdvertise> => request.get(`/home/advertise/list`, { params })


//广告详情 advertiseList
export const advertiseIDApi = (id: number): RSP<IAdvertiseList> => request.get(`/home/advertise/${id}`)

//修改广告 / home / advertise / update / { id }
export const advertiseUpdate = (params: IAdvertiseUpdateParams) => request.post(`/home/advertise/update/${params.id}`, params.advertise)


//删除广告 / home / advertise / delete
export const advertiseDelete = (params: number[]): RSP<any> => request.post(`/home/advertise/delete?ids=${params}`)


//mall-admin/home/advertise/create 添加
export const advertiseCreate = (params: IAdvertiseList): RSP<any> => request.post('/home/advertise/create', params)


// / mall - admin / home / advertise / update / status / { id }
export const advertiseupdatestatus = (params: IAdvertiseupdatestatusParams): RSP<any> => request.post(`/home/advertise/update/status/${params.id}?status=${params.status}`)